package cc.catface.dao.biz.app.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@ApiModel
public class AddArticleINDTO {

    @ApiModelProperty(value = "文章信息", required = true)
    private Article apArticle;
    @ApiModelProperty(value = "文章配置", required = true)
    private Config apArticleConfig;
    @ApiModelProperty(value = "文章内容", required = true)
    private Content apArticleContent;

    @Data
    @ApiModel
    public static class Article {
        @ApiModelProperty(value = "手机号")
        private String phone;
        @ApiModelProperty(value = "标题", required = true)
        private String title;
        @ApiModelProperty(value = "用户ID", required = true)
        private long userId;
        @ApiModelProperty(value = "作者昵称", required = true)
        private String userName;
        @ApiModelProperty(value = "文章所属频道ID", required = true)
        private long channelId;
        @ApiModelProperty(value = "频道名称", required = true)
        private String channelName;
        @ApiModelProperty(value = "文章布局(0无图1单图2多图)", required = true)
        private long layout;
        @ApiModelProperty(value = "文章标记(0普通1热点2置顶3精品)", required = true)
        private long flag;
        @ApiModelProperty(value = "文章图片,多张用英文逗号分隔", required = true)
        private String images;
        @ApiModelProperty(value = "文章标签(最多3个用英文逗号分隔)", required = true)
        private String labels;
        @ApiModelProperty(value = "省", required = true)
        private long provinceId;
        @ApiModelProperty(value = "市", required = true)
        private long cityId;
        @ApiModelProperty(value = "区县", required = true)
        private long countyId;
        @ApiModelProperty(value = "创建时间", required = true)
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date createdTime;
        @ApiModelProperty(value = "发布时间", required = true)
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date publishTime;
        @ApiModelProperty(value = "内容概要", required = true)
        private String overview;
    }

    @Data
    @ApiModel
    public static class Config {
        @ApiModelProperty(value = "可否评论(1是0否)", required = true)
        private long isComment;
        @ApiModelProperty(value = "可否转发(1是0否)", required = true)
        private long isForward;
    }

    @Data
    @ApiModel
    public static class Content {
        @ApiModelProperty(value = "详细文章内容", required = true)
        private String content;
    }


}
